import React from 'react';
import PropTypes from 'prop-types';
import { Button } from '@ant-design/react-native';
import FontAwesome from 'react-native-vector-icons/FontAwesome';

import styles from './styles';

const AddButton = ({
    navigation, action, getList, id,
}) => (
    <Button
        style={styles.addButton}
        type="primary"
        onPress={() => navigation.push(action, { getList, id })}
    >
        <FontAwesome
            name="plus"
            size={25}
        />
    </Button>
);
AddButton.defaultProps = {
    action: '',
    getList: '',
    id: null,
};
AddButton.propTypes = {
    action: PropTypes.string,
    getList: PropTypes.func,
    id: PropTypes.number,
};
export default AddButton;
